package  wibrst.visual{
	import flash.display.Shape;
	import wibrst.utils.ColorUtil;
	import wibrst.utils.MathUtil;
	
	/**
	 * ...
	 * @author wibrst@qq.com
	 */
	public class VRect extends Shape{
		
		public function VRect( w:Number = 100, h:Number = 100, clr:Number = -1, clrBdr:Number = 0 ) {
			_w = w;
			_h = h;
			
			if ( clr == -1 ) {
				_clr = ColorUtil.getRdmClr();
				trace( this, "clr:", clr.toString( 16 ).toLocaleUpperCase() );
			}else {
				_clr = clr;
			}
			
			_clrBdr = clrBdr;
			
			draw();
		}
		
		public function setClr( clr:Number ):void {
			_clr = clr;
			draw();
		}
		
		public function setClrBdr( clrBdr:Number ):void {
			_clrBdr = clrBdr;
			draw();
		}
		
		private function draw():void {
			this.graphics.clear();
			this.graphics.lineStyle( 0, _clrBdr, 1);
			this.graphics.beginFill( _clr, .8 );
			this.graphics.drawRoundRect( 0, 0, _w, _h, 6, 6 );
			this.graphics.endFill();
		}
		
		private var _w:Number;
		private var _h:Number;
		private var _clr:Number;
		private var _clrBdr:Number;
		
	}

}